/*
 * Copyright (C) 2024-2025 Deepin Technology Co., Ltd.
 *
 * Author:     zhangbingyi <zhangbingyi@uniontech.com>
 *
 * Maintainer: zhangbingyi <zhangbingyi@uniontech.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#pragma once

#include "widgets/hframe1.h"

#include <QLabel>


//#include <DFrame>
//#include <DLabel>
//#include <DTipLabel>

namespace def {
namespace widgets {
class SelectedIconWidget;
}
} // namespace def

class QGraphicsOpacityEffect;

using namespace def::widgets;

class SecurityLevelItem : public HFrame1
{
    Q_OBJECT
public:
    explicit SecurityLevelItem(QWidget *parent = nullptr);
    ~SecurityLevelItem();
    // 设置左侧图标
    void setIcon(const QIcon &icon);
    // 设置等级文字
    void setLevelText(const QString &text);
    // 设置提示文字
    void setTipText(const QString &text);
    // 设置警告提示文字
    void setWarningText(const QString &test);
    // 设置是否选中
    void setSelected(const bool &selected);
    // 设置是否可用
    void setEnable(const bool &enable);

    // 设置相关标签名称
    void setAccessibleParentText(QString sAccessibleName);

    // 设置文案是否换行
    void setTipLabelTextWordWrap(bool bl);

    // 设置文案省略显示模式
    void setTipLabelTextElideMode(Qt::TextElideMode elideMode);

protected:
    void mousePressEvent(QMouseEvent *event);

Q_SIGNALS:
    void clicked();

private:
    QWidget *m_firstLayerWidgt;
    QLabel *m_icon; // 左侧图标
    QLabel *m_levelLabel; // 等级文字
    QLabel *m_tipLabel; // 提示文字
    QLabel *m_tipWarningLabel; // 警告提示文字
    SelectedIconWidget *m_selectedIconWidget;
    bool m_canClick; // 是否可点击
};

